package com.education.service.impl;

import com.education.dao.ImageMapper;
import com.education.pojo.Image;
import com.education.service.IFileService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author 林心晨
 * @Title:
 * @Package
 * @Description:
 * @date create in 5.11  14:26
 */
@Service("iFileService")
@Transactional
public class FileServiceImpl implements IFileService {

    @Autowired
    private ImageMapper imageMapper;

    public PageInfo list(int pageNum , int pageSize){
        PageHelper.startPage(pageNum, pageSize);
        List<Image> imageList = imageMapper.selectAll();
        if (CollectionUtils.isEmpty(imageList)){
            return null ;
        }
        PageInfo pageInfo = new PageInfo();
        pageInfo.setList(imageList);
        return pageInfo ;
    }


}
